using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration; using Sispe.Entities;

namespace Sispe.Repository.Mapping
{
    public class CLIENTEMap : EntityTypeConfiguration<CLIENTE>
    {
        public CLIENTEMap()
        {
            // Primary Key
            this.HasKey(t => t.IdCliente);

            // Properties
            this.Property(t => t.Ruc)
                .HasMaxLength(50);

            this.Property(t => t.RazonSocial)
                .IsRequired()
                .HasMaxLength(350);

            // Table & Column Mappings
            this.ToTable("CLIENTE");
            this.Property(t => t.IdCliente).HasColumnName("IdCliente");
            this.Property(t => t.Ruc).HasColumnName("Ruc");
            this.Property(t => t.RazonSocial).HasColumnName("RazonSocial");
        }
    }
}
